<?php
//包含数据库配置文件
include '../../public/dbconfig.php';
//包含函数库文件
include '../../public/func.inc.php';
//调用函数
$link = conn();
//var_dump($link);
$title = $_POST['title'];
//var_dump($title);
//exit;
$content = $_POST['content'];
$cid = $_POST['cid'];
//var_dump($pid);
//exit;
$sql = "update bbs_post set title='{$title}',content='{$content}' where id='{$cid}'";
//var_dump($sql);
//exit;
$res = mysqli_query($link,$sql);
if($res){
	echo '<script>alert("修改成功");window.location.href="list.php";</script>';
}else{
	echo '<script>alert("修改失败");window.location.href="edit.php?pid='.$pid.'";</script>';
	
}
mysqli_close($link);